FROM node:current-alpine3.16 as builder
WORKDIR /app
COPY . .
RUN npm i -g pnpm
RUN pnpm install
RUN pnpm build

FROM nginx:stable-alpine
EXPOSE 80
EXPOSE 443
COPY --from=builder /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf